﻿// -----------------------------------------------------------------------
// <copyright file="Electric.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex03.GarageLogic
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public sealed class Electric : EnergySource
    {
        public void ChargeBattery(float i_AmountToCharge)
        {
            if (this.m_CurrentEnergyLevel + i_AmountToCharge > this.m_MaxEnergyLevel || i_AmountToCharge < 0)
            {
                throw new ValueOutOfRangeException(0, (m_MaxEnergyLevel - CurrentEnergyLevel) * 60, "Amount to charge is not between limits");
            }

            this.m_CurrentEnergyLevel += i_AmountToCharge;
        }
    }
}
